package com.ruoyi.course.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.course.mapper.SHomeworkQuestionMapper;
import com.ruoyi.course.domain.SHomeworkQuestion;
import com.ruoyi.course.service.ISHomeworkQuestionService;

/**
 * 学生作业问题Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-01
 */
@Service
public class SHomeworkQuestionServiceImpl implements ISHomeworkQuestionService 
{
    @Autowired
    private SHomeworkQuestionMapper sHomeworkQuestionMapper;

    /**
     * 查询学生作业问题
     * 
     * @param id 学生作业问题主键
     * @return 学生作业问题
     */
    @Override
    public SHomeworkQuestion selectSHomeworkQuestionById(Long id)
    {
        return sHomeworkQuestionMapper.selectSHomeworkQuestionById(id);
    }

    /**
     * 查询学生作业问题列表
     * 
     * @param sHomeworkQuestion 学生作业问题
     * @return 学生作业问题
     */
    @Override
    public List<SHomeworkQuestion> selectSHomeworkQuestionList(SHomeworkQuestion sHomeworkQuestion)
    {
        return sHomeworkQuestionMapper.selectSHomeworkQuestionList(sHomeworkQuestion);
    }

    /**
     * 新增学生作业问题
     * 
     * @param sHomeworkQuestion 学生作业问题
     * @return 结果
     */
    @Override
    public int insertSHomeworkQuestion(SHomeworkQuestion sHomeworkQuestion)
    {
        sHomeworkQuestion.setCreateTime(DateUtils.getNowDate());
        return sHomeworkQuestionMapper.insertSHomeworkQuestion(sHomeworkQuestion);
    }

    /**
     * 修改学生作业问题
     * 
     * @param sHomeworkQuestion 学生作业问题
     * @return 结果
     */
    @Override
    public int updateSHomeworkQuestion(SHomeworkQuestion sHomeworkQuestion)
    {
        sHomeworkQuestion.setUpdateTime(DateUtils.getNowDate());
        return sHomeworkQuestionMapper.updateSHomeworkQuestion(sHomeworkQuestion);
    }

    /**
     * 批量删除学生作业问题
     * 
     * @param ids 需要删除的学生作业问题主键
     * @return 结果
     */
    @Override
    public int deleteSHomeworkQuestionByIds(Long[] ids)
    {
        return sHomeworkQuestionMapper.deleteSHomeworkQuestionByIds(ids);
    }

    /**
     * 删除学生作业问题信息
     * 
     * @param id 学生作业问题主键
     * @return 结果
     */
    @Override
    public int deleteSHomeworkQuestionById(Long id)
    {
        return sHomeworkQuestionMapper.deleteSHomeworkQuestionById(id);
    }
}
